<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <h:form id="faltaSearch" styleClass="edit">
    
        <rich:simpleTogglePanel label="#{messages['application.label.searchParameters']}" switchType="ajax">
        
        
        </rich:simpleTogglePanel>
        
        <div class="actionButtons">
            <h:commandButton id="search" value="#{messages['application.label.search']}" action="/FaltaList.xhtml"/>
        </div>
        
    </h:form>
    
    <rich:panel>
        <f:facet name="header">#{messages['application.label.searchResults']}</f:facet>
    <div class="results" id="faltaList">

    <h:outputText value="#{messages['application.falta.empty']}" 
               rendered="#{empty faltaList.resultList}"/>
               
    <rich:dataTable id="faltaList" 
                var="falta"
              value="#{faltaList.resultList}" 
           rendered="#{not empty faltaList.resultList}">
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="#{messages['application.disciplina.label']} #{faltaList.order=='disciplina.idtDisciplina asc' ? messages.down : ( faltaList.order=='disciplina.idtDisciplina desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{faltaList.order=='disciplina.idtDisciplina asc' ? 'disciplina.idtDisciplina desc' : 'disciplina.idtDisciplina asc'}"/>
                </s:link>
            </f:facet>
            #{falta.disciplina.nomDisciplina}
        </h:column>
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="#{messages['application.turma.label']} #{faltaList.order=='turma.idtTurma asc' ? messages.down : ( faltaList.order=='turma.idtTurma desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{faltaList.order=='turma.idtTurma asc' ? 'turma.idtTurma desc' : 'turma.idtTurma asc'}"/>
                </s:link>
            </f:facet>
            #{falta.turma.codTurma}
        </h:column>
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="#{messages['application.falta.label.data']} #{faltaList.order=='datFalta asc' ? messages.down : ( faltaList.order=='datFalta desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{faltaList.order=='datFalta asc' ? 'datFalta desc' : 'datFalta asc'}"/>
                </s:link>
            </f:facet>
            <h:outputText value="#{falta.datFalta}">
                <s:convertDateTime type="date" pattern="dd/MM/yyyy" dateStyle="short"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">#{messages['application.label.action']}</f:facet>
            <s:link view="/#{empty from ? 'Falta' : from}.xhtml" action="#{faltaHome.prepareSelect}"
                   value="#{messages['application.label.select']}" 
                      id="falta">
                <f:param name="faltaIdtFalta" 
                        value="#{falta.idtFalta}"/>
            </s:link>
        </h:column>
    </rich:dataTable>

    </div>
    </rich:panel>
    
    <div class="tableControl">
      
        <s:link view="/FaltaList.xhtml" 
            rendered="#{faltaList.previousExists}" 
               value="#{messages.left}#{messages.left} #{messages['application.label.first']}"
                  id="firstPage">
          <f:param name="firstResult" value="0"/>
        </s:link>
        
        <s:link view="/FaltaList.xhtml" 
            rendered="#{faltaList.previousExists}" 
               value="#{messages.left} #{messages['application.label.previous']}"
                  id="previousPage">
            <f:param name="firstResult" 
                    value="#{faltaList.previousFirstResult}"/>
        </s:link>
        
        <s:link view="/FaltaList.xhtml" 
            rendered="#{faltaList.nextExists}" 
               value="#{messages['application.label.next']} #{messages.right}"
                  id="nextPage">
            <f:param name="firstResult" 
                    value="#{faltaList.nextFirstResult}"/>
        </s:link>
        
        <s:link view="/FaltaList.xhtml" 
            rendered="#{faltaList.nextExists}" 
               value="#{messages['application.label.last']} #{messages.right}#{messages.right}"
                  id="lastPage">
            <f:param name="firstResult" 
                    value="#{faltaList.lastFirstResult}"/>
        </s:link>
        
    </div>
    
    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/FaltaEdit.xhtml"
                    id="create" 
                 value="#{messages['application.label.create']}">
            <f:param name="faltaIdtFalta"/>
        </s:button>
    </s:div>
    
</ui:define>

</ui:composition>

